// src/stores/user.js
import {
	defineStore
} from 'pinia';

export const useUserStore = defineStore('user', {
	state: () => ({
		userData: {
			userInfo: {},
			signInfo: {}
		},
		currentUserInfo: {
			userInfo: {},
			signInfo: {}
		}
	}),

	actions: {
		updateUserData(data) {
			this.userData = {
				...data
			}
		},
		updateCurrentUserInfo(data) {
			this.currentUserInfo = {
				...data
			}
		}

	},
	persist: {
		storage: {
			setItem(key, value) {
				uni.setStorageSync(key, value)
			},
			getItem(key) {
				return uni.getStorageSync(key)
			}
		},


	}
});